/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cassys.ejb.clients;

import cassys.application.services.ModuleManagementBeanRemote;
import cassys.domain.classManagement.*;
import java.util.List;

/**
 *
 * @author User
 */
public class ModuleManagementDelegate {

    private ModuleManagementBeanRemote moduleManagementBean = null;

    public ModuleManagementDelegate() {
        try {
            System.out.println("Init Service locator");
            moduleManagementBean = ServiceLocator.getInstance().lookupModuleManagementBean();
        } catch (Exception e) {
            System.out.println(e.getStackTrace());
        }
    }

    public List<Lecture> getAllLecturers() {
        System.out.println("in module management delegate :)");
        return moduleManagementBean.getAllLecturers();
    }

    public List<ModuleType> getModuleTypes() {

        return moduleManagementBean.getModuleTypes();
    }

    public void crateModule(Module module) {
        System.out.println(module.toString());
        moduleManagementBean.createModule(module);
    }

    public List<Module> getAllModules() {
        return moduleManagementBean.getAllModules();
    }

    public Module findByClassGroupId(long moduleId) {
        return moduleManagementBean.findByModuleId(moduleId);
    }

    public void updateModule(Module module) {
        moduleManagementBean.updateModule(module);
    }

    public void deleteModule(Module module) {
        moduleManagementBean.deleteModule(module);
    }
}
